package com.prs.crm.domain.crm;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.context.FileUtil;
import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 跟单
 * @author zhoupeng 2012-02-15
 *
 */
@Entity
@Table(name="crm_documentary")
public class DocumenTary extends BaseEntity {
	private static final long serialVersionUID = 1L;
	
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	
	private String linkman; //联系人
	@ManyToOne
	private DocumenTaryStyle style;   //跟单方式
	
	private String content;  //跟单内容
	
	private Date day;              //跟单时间
	private String taryperson;  //跟单人
	private String shareperson;  //共享人员
	
	@ManyToOne
	private Customer customer;  //客户
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; //附件
	@Column(name="documenTary_file")
	private String documenTary_file;
	
	@ManyToOne
	private CustomerAgent customerAgent;  //代理商
	@ManyToOne
	private Linkman linkman1;  //联系人
	@ManyToOne 
	private CustomerSupplier customerSupplier; //供应商
	@ManyToOne
	private CustomerProject customerProject;  //所属项目
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getLinkman() {
		return linkman;
	}
	public void setLinkman(String linkman) {
		this.linkman = linkman;
	}
	
	public DocumenTaryStyle getStyle() {
		return style;
	}
	public void setStyle(DocumenTaryStyle style) {
		this.style = style;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public Date getDay() {
		return day;
	}
	public void setDay(Date day) {
		this.day = day;
	}
	public String getTaryperson() {
		return taryperson;
	}
	public void setTaryperson(String taryperson) {
		this.taryperson = taryperson;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	public CustomerAgent getCustomerAgent() {
		return customerAgent;
	}
	public void setCustomerAgent(CustomerAgent customerAgent) {
		this.customerAgent = customerAgent;
	}
	public Linkman getLinkman1() {
		return linkman1;
	}
	public void setLinkman1(Linkman linkman1) {
		this.linkman1 = linkman1;
	}
	public CustomerSupplier getCustomerSupplier() {
		return customerSupplier;
	}
	public void setCustomerSupplier(CustomerSupplier customerSupplier) {
		this.customerSupplier = customerSupplier;
	}
	public CustomerProject getCustomerProject() {
		return customerProject;
	}
	public void setCustomerProject(CustomerProject customerProject) {
		this.customerProject = customerProject;
	}
	public String getShareperson() {
		return shareperson;
	}
	public void setShareperson(String shareperson) {
		this.shareperson = shareperson;
	}
	public String getDocumenTary_file() {
		return documenTary_file;
	}
	public void setDocumenTary_file(String documenTaryFile) {
		documenTary_file = documenTaryFile;
	}
	
}
